home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
UTILREEN
/
NEWKEY.LZH
/
NEWKEY54.EXE
/
EXAMPLE.KEY
< prev
next >
Wrap
Text File
|
1990-10-27
|
13KB
|
296 lines
* This macro file illustrates many of the various functions that can be
* done in Newkey. These macros are designed to be run from the DOS command
* line.
*
* CED should not be loaded (if you don't know what CED is then don't
* worry, you don't have it).
*
* Illustrates if functions - This macro will do a "dir/p" and clear
* all "Stike a key" messages until the directory listing is done. It does
* this by starting the directory listing and then calling <chkdir1> to
* do rest of processing.
{begdef chkdir}dir /p<enter><chkdir1>
{enddef}
* Part 2 of if function example - Logic is as follows:
*
* Wait for 1/2 second to give directory listing time to fill screen
* If "bytes free" displayed then exit, directory listing is done
* If "Strike a key" displayed, then screen is full, "strike" the enter
* key to continue.
* Branch to start of macro to repeat process
{begdef chkdir1}
{wait 00:00:50}
{ifefscr}bytes free{endifef}{return}
{ifefscr}Strike a key{endifef}<enter>
<chkdir1>
{enddef}
* Illustrates print screen function
{begdef prtscrn}Print screen{prtscrn}
{enddef}
* Illustrates beep function
{begdef beep}Beep now{wait 00:00:30}{beep} beep done<esc>
{enddef}
* Illustrates cls the clear screen function
{begdef cls}Clear the screen {cls} clear done<esc>
{enddef}
* Illustrates the cursor on and off functions
{begdef cursor}Turn the cursor off {cursoff} press any key to continue
{waitany}<esc>
Turn cursor back on {curson}
{enddef}
* Illustrates date and time function formats
{begdef date}<esc>cls<enter>
Sample Date Functions <esc>
template what Newkey returns <esc>
mm/dd/yy {date}mm/dd/yy{enddate} <esc>
yy/mm/dd {date}yy/mm/dd{enddate} <esc>
mm-dd-yy {date}mm-dd-yy{enddate} <esc>
mm/dd/yyyy {date}mm/dd/yyyy{enddate} <esc>
<esc>
mmmm dd, yyyy {date}mmmm dd, yyyy{enddate} <esc>
mmm dd, yyyy {date}mmm dd, yyyy{enddate} <esc>
dddd, mmm dd, yyyy {date}dddd, mmm dd, yyyy{enddate} <esc>
ddd, mmm dd, yyyy {date}ddd, mmm dd, yyyy{enddate} <esc>
<esc>
Sample Time Functions <esc>
template what Newkey returns <esc>
hh:mm:ss {time}hh:mm:ss{endtime} = twelve hour clock time <esc>
hh:mm xx {time}hh:mm xx{endtime} = twelve hour clock time <esc>
hh:mm XX {time}hh:mm XX{endtime} = twelve hour clock time <esc>
tt:mm:ss {time}tt:mm:ss{endtime} = 24 hour clock time <esc>
<esc>
Press any key to learn how you can create your own date and time
macros.{waitany}
<ESC>
{cls}
Using the basic building blocks of the date and time functions you <esc>
can build your own date/time template. Just type these as you would <esc>
like to see them when they are played back. You are not limited to <esc>
just these building blocks. Any characters found in the date/time <esc>
function which can not be interpreted as one of the building blocks <esc>
will be returned just as they are. This means that you have complete<esc>
flexibility in creating your own date/time function. <esc>
<esc>
Time functions Date functions <esc>
<esc>
hh = hours on twelve hour clock dd = day <esc>
mm = minutes mm = month <esc>
ss = seconds yy,yyy,yyyy = year <esc>
tt = hours on 24 hour clock ddd,mmm = 3 char abbreviation <esc>
xx = am,pm dddd,mmmm = full name <esc>
XX = AM,PM <esc>
{enddef}
* Illustrates begprint function
{begdef print}send something to printer on LPT1
{begprint}hello world!<enter>{endprint}<esc>
{enddef}
* Illustrates setting caps lock
{begdef caps}save caps lock status{capssave}<esc>
turn caps lock on{capson} - type abc {ffld}{ffld}{ffld}<esc>
turn caps lock off{capsoff} - type abc {ffld}{ffld}{ffld}<esc>
restore caps lock status{capsrest}<esc>
{enddef}
* Illustrates setting num lock
{begdef num}save num lock status{numsave}<esc>
turn num lock on{numon} - type 123 on numeric keypad {ffld}{ffld}{ffld}<esc>
turn num lock off{numoff} - type 123 on numeric keypad {ffld}{ffld}{ffld}<esc>
restore num lock status{numrest}<esc>
{enddef}
* Illustrates setting scrl lock
{begdef scrl}save scrl lock status{scrlsave}<esc>
turn scrl lock on{scrlon} - no way to demonstrate from dos command line<esc>
turn scrl lock off{scrloff} - no way to demonstrate from dos command line<esc>
restore scrl lock status{scrlrest}<esc>
{enddef}
* Illustrates time function
{begdef time}current time is {time}hh:mm:ss xx{endtime}<esc>
{enddef}
* Illustrates available set options
{begdef setopts}Merging example.key
{begmerge}example.key{endmerge} Merge is done<esc>{enddef}
* Clearing macros from memory
* This macro will clear all macros from memory except for guarded macros
* and the macro being used to call it. It will take longer than the same
* function done from the menu.
{begdef clear}Clearing macros from memory
{clearmac}Clear is done<esc>{enddef}
* Merging a macro file
{begdef mergfile}Merging example.key
{begmerge}example.key{endmerge} Merge is done<esc>{enddef}
* Merging a macro file overwriting duplicates
{begdef mergovrw}Merging example.key overwriting duplicates
{begmergo}example.key{endmergo} Merge is done<esc>{enddef}
* Loading a macro file
{begdef loadfile}Loading example.key
{begload}example.key{endload} Load is done<esc>{enddef}
* Saving a macro file
{begdef savefile}Saving example1.key
{begsave}example1.key{endsave} Save is done<esc>{enddef}
* used for translation bypass demonstration
{begdef &}Hello!{enddef}
*
{begdef alt0}level0{enddef}
* nested macro demonstration
{begdef alt1}level1<alt2>{enddef}
*
{begdef alt2}level2<alt3>{enddef}
*
{begdef alt3}level3<alt4>{enddef}
*
{begdef alt4}level4<alt5>{enddef}
*
{begdef alt5}level5<alt6>{enddef}
*
{begdef alt6}level6<alt7>{enddef}
*
{begdef alt7}level7<alt8>{enddef}
*
{begdef alt8}level8<alt9>{enddef}
*
{begdef alt9}level9<alt0>{enddef}
* clear screen demonstration
{begdef altf1}{cls} Clear screen macro demonstration <esc>
<esc>I am going to clear your screen. Press any key when you are
<esc>ready.{ffld}{cls}Newkey can clear your screen whenever you wis
h.{enddef}
* beep demonstration
{begdef altf2}{cls}<tab> Beep macro demonstration <esc><esc>I
am going to beep. {beep} Newkey macros can beep {beep}<esc> wheneve
r you wish.<esc>{enddef}
* screen off/on demonstration
{begdef altf3}{cls}<tab> Screen off macro demonstration <esc>
<esc>I am going to turn the screen off when you hit enter. To turn
the screen <esc>back on press any key a couple of times. Press en
ter when ready.{vfld} <esc>{scroff}{ffld}{ffld} <esc><esc>Now I'm
going to turn off the screen for 3 seconds and then turn it on.
<esc>Press any key when ready. {ffld}{scroff}{wait 00:03:00}
{scron} <esc>{enddef}
* 5 second time delay
{begdef altt}<esc>{set slowtype off}5 second time delay begins now:
{wait 00:05:00}
and ends now. <esc>{enddef}
* Macro which calls itself
{begdef ctrlw}<esc>{set slowtype on}Hi! I'm <caps,>ctrlw<caps.>. I will ca
ll myself over and over until you <esc>stop me by pressing <caps,>c
trlesc<caps.> (ctrl\ for enhanced), the <esc>Newkey cancel key.
<esc>I will type slowly since I have turned on slow typing mode so
that <esc>you can follow what is happening.<esc><esc><ctrlw>
{enddef}
* Fixed Length Fill-in-the-blanks Pause Demonstration
{begdef f1}{cls}{set slowtype off} Fixed length fill-in-the-blanks de
monstration <esc><esc>Enter 2 keystrokes: {ffld}{ffld} and Newkey
will finish for you.<esc>{enddef}
* Playback multi-character macro demonstration
{begdef f10}{cls}<esc><esc><esc><esc><esc><esc><esc>
Playback multi-character macro demonstration <esc>
To play back a multi-character macro, follow these steps: <esc><esc>
1. Press <caps,>alt,<caps.> <esc>
2. Type in "multimac" <esc>
3. Press enter <esc>{enddef}
* Variable Length Fill-in-the-blanks Pause Demonstration
{begdef f2}{cls}{set slowtype off} Variable length fill-in-the-blanks d
emonstration <esc><esc>Enter any number of keystrokes followed by e
nter: {vfld} <esc>and Newkey will finish for you. <esc>
{enddef}
* Translation Bypass Demonstration
{begdef f3}{cls}{set slowtype off} Translation bypass demonstration
<esc><esc>Enter '{notran &}' followed by enter: {vfld}<esc>You will
notice that '{notran &}' has been redefined to 'HELLO'.<esc>Now enter
ctrl-2 and '{notran &}' followed by enter: {vfld} <esc><esc>You will
notice that '{notran &}' was returned, not 'HELLO'. <esc>This is an
example of Newkey's translation bypass feature <esc>{enddef}
* Time Delay Demonstration
{begdef f4}{cls}{set slowtype off} Time delay demonstration
<esc><esc>
Enter ALT T. Newkey will wait for 5 seconds before continuing. <esc>
You will notice that the cursor has become a fat bar. <esc>{enddef}
* Dynamic Display Feature Demonstration
{begdef f5}{cls}{set slowtype off}
Dynamic display feature demonstration: <esc><esc>
Enter CTRL / (ALT / for enhanced).
This will allow you to invoke several <esc>Newkey functions without
leaving your current program. <esc><esc>This feature is a
lways available, no matter what program <esc>you are in. When you
are finished Newkey will restore <esc>your screen exactly where you
left off. <esc>{enddef}
* Slow typing mode demonstration
{begdef f6}{cls}{set slowtype off} Slow Typing Mode Dem
onstration <esc><esc>{set slowtype on}Slow typing mode has just b
een turned on. You will notice how <esc>slowly Newkey is typing.
Now we will turn slow typing off.{set slowtype off} <esc>Notice how quickly
Newkey is typing. Much too fast for you <esc>to follow what is hap
pening. <esc>{enddef}
* Defining macro within macro demonstration
{begdef f7}{cls}{set slowtype off}<esc><esc><esc> Defining macro
within macro demonstration <esc><esc>This macro will def
ine <caps,>ctrlq<caps.> to be whatever you type in. <esc>Type what
ever you want to and when you are done press <esc><caps,>alt-
<caps.> to end it. Start now: <esc>{begdef ctrlq}<esc>Now
that you have finished, press <caps,>ctrlq<caps.> and watch <esc>wh
at you typed in returned. Newkey will press it for <esc>you first
:<esc><ctrlq>{enddef}
* Macro calls Itself and Cancel Newkey Demonstration
{begdef f8}{cls}{set slowtype off} Macro Calls Itself and Cancel Newkey P
rocessing Demonstration<esc><esc>Press <caps,>ctrlw<caps.>. This w
ill start a macro which calls itself.<esc>This macro will continue
to execute until you press the Newkey<esc>cancel processing key,
<caps,>ctrldel<caps.> (ctrl\ for enhanced). <esc>This key cancels
all current Newkey processing and clears the keyboard <esc>buffer.
Newkey will press <caps,>ctrlw<caps.> for you.<esc><ctrlw>{enddef}
* Macro which calls Newkey's dynamic display features
{begdef f9}{cls}{set slowtype off} Macro which calls Newkey's dynamic
display features<esc><esc>This macro will actually invoke Newkey's
dynamic display features <esc>to automatically change one of the N
ewkey parameters. In this <esc>case we will turn off the screen sa
ver. Press any key when you <esc>are ready.{ffld}<esc>{cmd}4pn
<esc><esc><endcmd><esc>That was easy wasn't it.<esc>{enddef}
* Multi-character macro
{begdef multimac}<esc> Hi! I'm a multi-character macro named "m
ultimac". I am used<esc>by <caps,>f10<caps.> to demonstrate multi-
character macros.<esc>{enddef}
* Multi-character macro which calls itself
{begdef recurmac}<esc>{set slowtype on}Hi! I'm <caps,>recurmac<caps.>. I w
ill call myself over and over until <esc>you stop me by pressing
<caps,>ctrldel<caps.> (ctrl\ for enhanced), the <esc>Newkey cancel
key. <esc>I will type slowly since I have turned on slow typing m
ode so that <esc>you can follow what is happening.<esc><esc>
<recurmac>{enddef}